# CHECKLIST #
# optimization flags are on
# avg is in all directories
# thru is a sufficient value
#

echo "Did you remember to update svn?"
echo "Did you make sure the program avg is in this directory?"
echo "Did you check the iteration value 'thru'?"
echo "DID YOU MAKE SURE AVG IS COMPILED ON THIS MACHINE?"
echo "DID YOU MAKE SURE ALL TEST PROGRAMS ARE COMPILED ON THIS MACHINE?"

#!/bin/sh
thru=15;
thru2=4;

`rm -rf region_results`
`mkdir region_results`

######## REGIONS RESULTS SECTION ########
dir=region_results;

echo "Beginning test on region multiplications"

enum2=1;
while [ $enum2 -le $thru2 ]; do
  `./gf_basic_tester 32 default 100 >> $dir/tmp_results_region_w32`
  enum2=`echo $enum2 | awk '{printf $1+1}'`
done

`cat $dir/tmp_results_region_w32 | grep "Megabytes of" | grep "Test 0:" | awk '{printf $3 "\n"}' > $dir/results_region_T0_w32`
`cat $dir/tmp_results_region_w32 | grep "Megabytes of" | grep "Test 1:" | awk '{printf $3 "\n"}' > $dir/results_region_T1_w32`
`cat $dir/tmp_results_region_w32 | grep "Megabytes of" | grep "Test 2:" | awk '{printf $3 "\n"}' > $dir/results_region_T2_w32`

`echo "Width 32, Tests 0-2" >> $dir/results_w32`
`echo "" >> $dir/results_w32`
`cat $dir/results_region_T0_w32 | ./avg >> $dir/results_w32`
`cat $dir/results_region_T1_w32 | ./avg >> $dir/results_w32`
`cat $dir/results_region_T2_w32 | ./avg >> $dir/results_w32`

`rm $dir/tmp_results_region_w32`
`rm $dir/results_region_T*`

enum2=1;
while [ $enum2 -le $thru2 ]; do
  `./gf_basic_tester 32 comp4 100 >> $dir/tmp_composite_w32`
  enum2=`echo $enum2 | awk '{printf $1+1}'`
done

`cat $dir/tmp_composite_w32 | grep "Megabytes of" | grep "Test 0:" | awk '{printf $3 "\n"}' > $dir/results_comp_region_T0_w32`
`cat $dir/tmp_composite_w32 | grep "Megabytes of" | grep "Test 1:" | awk '{printf $3 "\n"}' > $dir/results_comp_region_T1_w32`
`cat $dir/tmp_composite_w32 | grep "Megabytes of" | grep "Test 2:" | awk '{printf $3 "\n"}' > $dir/results_comp_region_T2_w32`

`echo "Width 32, Tests 0-2" >> $dir/results_comp_w32`
`echo "" >> $dir/results_comp_w32`
`cat $dir/results_comp_region_T0_w32 | ./avg >> $dir/results_comp_w32`
`cat $dir/results_comp_region_T1_w32 | ./avg >> $dir/results_comp_w32`
`cat $dir/results_comp_region_T2_w32 | ./avg >> $dir/results_comp_w32`

`rm $dir/tmp_composite_w32`
`rm $dir/results_comp_region_T*`

echo "Finished test on region multiplication"


